package org.fengling.readingplatform.novel.factory;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class SortFactory {
    private static final Map<String, HandlerSortStrategyFactory> strategyMap = new ConcurrentHashMap<>();

    public static HandlerSortStrategyFactory getInvokeStrategy(String strategy){
        return strategyMap.get(strategy);
    }

    public static void register(String strategy, HandlerSortStrategyFactory handler){
        if(null == strategy || null == handler){
            return ;
        }
        strategyMap.put(strategy, handler);
    }
}
